﻿
using FileZillaConfig.Types;
namespace FileZillaConfig.ConfigClasses
{
    public class Admin
    {
        private int _adminPort = 14147;
        private Password _adminPassword;
        private string _IPBindings;
        private string _IPAddresses;

        /// <summary>
        /// IP addresses which are allowed to connect to the admin interface
        /// </summary>
        public string IPAdresses
        {
            get { return _IPAddresses; }
            set { _IPAddresses = value; }
        }


        /// <summary>
        /// Bind the admin interfeca t the following IPs
        /// </summary>
        public string IPBindings
        {
            get { return _IPBindings; }
            set { _IPBindings = value; }
        }


        /// <summary>
        /// Minimum password length is 6 characters. Pass null to disable password
        /// </summary>
        public Password Password
        {
            get { return _adminPassword; }
            set { _adminPassword = value; }
        }


        /// <summary>
        /// Port on which the admin interface should listen (1-65535)
        /// </summary>
        public int Port
        {
            get { return _adminPort; }
            set {
                if (value >= 1 && value <= 65535)
                {
                    _adminPort = value;
                }
                else
                {
                    throw new System.Exception("Value must be integer between 1 and 65535.");
                }
                 
            }
        }



        public Admin()
        {
            this._adminPassword = new Password();
        }

        
    }
}
